package com.guguguweb.rpc.Test.service.imp;

import com.guguguweb.rpc.Test.service.ResultData;
import com.guguguweb.rpc.Test.service.TroubleService;
import com.guguguweb.rpc.annotation.GuRPCServerService;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;



@Slf4j
@GuRPCServerService
public class TroubleServiceImp implements TroubleService {

    @Override
    public ResultData exchang(ResultData resultData, List<Object> list) {

        log.info("{}",resultData);
        log.info("{}",list);

        ResultData res = new ResultData();
        list.add("123");
        res.setCode(100);
        res.setMessage("消费者消费成功");
        Map<String, List<Object>> data = resultData.getData();
        data.put("消费者队列",list);
        res.setData(data);
        return res;
    }

    @Override
    public List<String> get(List<String> list) {

        ArrayList<String> list1 = new ArrayList<>();
        for(int i = 1;i <list.size();i++){
            list1.add(String.valueOf(i));
        }
        return list1;
    }
}
